<template>
  <view class="viewport">
    <view class="cart">
      <view class="cart-list" v-if="memberStore.profile">
        购物车列表 {{ memberStore.profile.nickname }}
      </view>
      <view v-else>请登录</view>
    </view>
    <scroll-view scroll-y @scrolltolower="onScrolltolower" class="scroll-view">
      <EsListMore ref="guessRef"></EsListMore>
    </scroll-view>
  </view>
</template>

<script setup lang="ts">
import { useGuessList } from '@/composable/guessLikeAPI'
const { guessRef, onScrolltolower } = useGuessList()

import { getCardListAPI } from '@/api/cart'
import { onLoad } from '@dcloudio/uni-app'
import { useMemberStore } from '@/stores'

onLoad(async () => {
  const res = await getCardListAPI()
  console.log(res, 'res')
})

// 获取用户信息
const memberStore = useMemberStore()
</script>

<style lang="scss">
page {
  width: 750rpx;
  height: 100%;
}
.viewport {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  .scroll-view {
    // flex: 1;
    min-height: 400rpx;
  }
}
</style>
